home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows 95 API Bible
/
Windows 95 API Bible 3 Disc Set.iso
/
Win32 API Bible Book 1 of 3.iso
/
chapte25
/
ex13.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-23
|
1KB
|
33 lines
#include <genstub.c>
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
switch (wParam)
{
case IDM_TEST:
{
CONTEXT context;
TCHAR szBuffer[128];
context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
GetThreadContext( GetCurrentThread(), &context );
wsprintf( szBuffer, "CS=%X, EIP=%X, FLAGS=%X, DR1=%X",
context.SegCs, context.Eip, context.EFlags, context.Dr1 );
MessageBox( hWnd, szBuffer, "Selected Values of Thread Context", MB_OK );
}
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return (DefWindowProc(hWnd, uMsg, wParam, lParam));
}
return (NULL);
}